//
//  SelfTopViewCell.m
//  iphone-graph
//
//  Created by yuzhuo on 2016/12/27.
//  Copyright © 2016年 yzapp. All rights reserved.
//

#import "SelfTopViewCell.h"
#import "UIColor+Util.h"
#import "Constant.h"

@implementation SelfTopViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self  = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if(self){
        self.accessoryType = UITableViewCellAccessoryNone;//
        [self initSubViews];
    }
    return self;
}

-(void)initSubViews{
    UIFont *font_30 = [UIFont systemFontOfSize:30];
    UIFont *font_16 = [UIFont systemFontOfSize:16];
    _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(18, 20, SCREEN_WIDTH -110, font_30.lineHeight)];
    _titleLabel.font = font_30;
    _titleLabel.textColor = [UIColor colorWithHexString:@"#4A4A4A"];
    _descLabel = [[UILabel alloc]initWithFrame:CGRectMake(18, 20+font_30.lineHeight+12, SCREEN_WIDTH -110, font_16.lineHeight)];
    _descLabel.font = font_16;
    _descLabel.textColor = [UIColor colorWithHexString:@"#888888"];
    _descLabel.text = @"查看并编辑个人资料";
    _avatar = [[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-15-60, 25, 60, 60)];
    [_avatar.layer setCornerRadius:30];
    [_avatar setContentMode:UIViewContentModeScaleAspectFill];
    _avatar.clipsToBounds = YES;
    
    [self.contentView addSubview:_titleLabel];
    [self.contentView addSubview:_descLabel];
    [self.contentView addSubview:_avatar];
    
}

#pragma mark -SetData

-(void)setData:(UserInfoEnity*)data
{
    _data = data;
    self.titleLabel.text = data.userName;
    self.avatar.image = data.avatar;
    
}


@end
